<template>
  <a-modal
    v-model:visible="visible"
    :mask-closable="false"
    :keyboard="false"
    :footer="null"
    width="100%"
    wrap-class-name="tn-model-full-scroll"
    :destroy-on-close="true"
  >
    <template #title>
      <a-page-header
        class="p-0"
        title="编辑流程"
        sub-title="添加节点：鼠标悬停在左侧节点上，长按鼠标左键，可将节点拖入进画布"
      >
      </a-page-header>
    </template>
    <logicflow
      :task-flow-id="props.taskFlowId"
      :task-entry-type="props.entryType"
      :is-modal="true"
      :hide-sign-setting="hideSignSetting"
      @updateFlow="updateFlow"
    />
  </a-modal>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import logicflow from '@/views/logicflow/index.vue'

const props = defineProps<{
  taskFlowId: string
  entryType: number
  hideSignSetting?: boolean
}>()

const emits = defineEmits(['updateFlow'])
const visible = ref(false)

const show = () => {
  visible.value = true
}
const updateFlow = (flag: boolean) => {
  if (flag) {
    emits('updateFlow', false)
    visible.value = false
  }
}

defineExpose({
  show
})
</script>
